/*
 * NumberConstructor.java
 *
 * Created on August 9, 2005, 7:23 PM
 *
 * (C) R. Alexander Milowski alex@milowski.com
 */

package com.milowski.monos.binomial;

import java.math.*;

/**
 *
 * @author R. Alexander Milowski
 */
public interface NumberConstructor<T extends Number>
{
   T parse(String value)
      throws NumberFormatException;
   
   public class ShortConstructor implements NumberConstructor<Short> {
      public Short parse(String value) {
         return Short.parseShort(value);
      }
   }
   public final ShortConstructor SHORT = new ShortConstructor();
   
   public class BigIntegerConstructor implements NumberConstructor<BigInteger> {
      public BigInteger parse(String value) {
         return new BigInteger(value);
      }
   }
   public final BigIntegerConstructor BIG_INTEGER = new BigIntegerConstructor();
}
